package wang.aweb.childcar.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import wang.aweb.childcar.filter.AgentFilter;
@Configuration
public class AgentFilterConfig {
    @Bean
    public AgentFilter agentFilter(){
        return new AgentFilter();
    }
    @Bean(name="agentFilterConf")
    public FilterRegistrationBean agentFilterConfig(){
        FilterRegistrationBean filterRegistrationBean=new FilterRegistrationBean();
        filterRegistrationBean.setFilter(agentFilter());
        filterRegistrationBean.addUrlPatterns("/agentApi/*");
        filterRegistrationBean.setName("agentFilterConf");
        return  filterRegistrationBean;
    }
}
